home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / Tools / vg-2.03 / video / mkgamma.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-05-03  |  961 b   |  41 lines

  1. /*
  2.  * Copyright (C) 1990-1992 Michael Davidson.
  3.  * All rights reserved.
  4.  *
  5.  * Permission to use, copy, modify, and distribute this software
  6.  * and its documentation for any purpose and without fee is hereby
  7.  * granted, provided that the above copyright notice appear in all
  8.  * copies and that both that copyright notice and this permission
  9.  * notice appear in supporting documentation.
  10.  *
  11.  * This software is provided "as is" without express or implied warranty.
  12.  */
  13.  
  14. #include    <stdio.h>
  15.  
  16. extern double log10(double);
  17.  
  18. #define    SCALE        (1 << 21)
  19. #define    HALF_SCALE    (1 << 20)
  20.  
  21. main()
  22. {
  23.     int        i, j;
  24.  
  25.     printf("long GammaLog10[256][2] =\n{\n");
  26.  
  27.     printf("    { %8ld, %8ld },\n",
  28.     0L,
  29.     (long)(log10((double) 0.5) * SCALE + HALF_SCALE));
  30.  
  31.     for (i = 1; i < 256; i++)
  32.     {
  33.     printf("    { %8ld, %8ld },\n",
  34.         (long)(log10((double)i) * SCALE + HALF_SCALE),
  35.         (long)(log10((double)i + 0.5) * SCALE + HALF_SCALE));
  36.     }
  37.  
  38.     printf("};\n");
  39.     exit(0);
  40. }
  41.